package com.wodan.zhongjinjicang.common.orm.bytesconverter.impl;

import com.wodan.zhongjinjicang.common.orm.bytesconverter.Converter;
import org.apache.commons.lang.StringUtils;



/**
 * string 类型转换器
 * @ClassName: StringConverter 
 * @author Administrator
 * @date 2015-1-10 下午3:51:05 
 * @history 
 *
 */
public class StringConverter implements Converter {
	
	@Override
	public Object fromString(String str) {
		return str;
	}
	
	@Override
	public String toString(Object obj) {
		return obj.toString();
	}
	
	@Override
	public boolean isNullOrEmpty(Object obj) {
		if(obj == null) {
			return true;
		}
		
		if (StringUtils.isBlank(String.valueOf(obj))) {
			return true;
		} else {
			return false;
		}
	}
}
